﻿@using Yglab
@model System.Collections.Generic.IEnumerable<Yglab.Models.Article>
@{
    ViewBag.Title = "YazarAra";
    Layout = "~/Views/Shared/LAYOUT.cshtml";
}

<h2>Yazar Ara</h2>

<div id="searchUserForm">
    @using( Html.BeginForm( "YazarAra" , "Ara" , FormMethod.Get ) ) {   
        <p>
            @Html.TextBox( "Ara" )
            <br />
            <input type="submit" value="Ara" />
        </p>     
    }
</div>

@{
    string Ara = @ViewBag.Ara ?? "Ara Not Set";
   
}


<!-- 
<h1>
    <text>
        @Ara
    </text>

</h1>

    -->

@if( Model != null && Model.Any() ) {
    <table class="gridtable">

       
            <tr>
                <th>Yazar İsmi</th>
                <th>Dergi Adı</th>
                <th>Yayınladığı Makalenin Versiyonları</th>
            </tr>
       
     


        @foreach( var item in Model ) {
     
            <tr>
                <td>
                    @item.Author.Name
                </td>
                <td>
                    @item.Journal.Name
                </td>
                <td>
                    <table class="gridtable">
                        @foreach( var v in @item.Versionns ) { 
                        
                            <thead>
                                <tr>
                                    <th>Version Id</th>
                                     <th>Makale Başlığı</th>
                                </tr>

                            </thead>
                            <tr>
                                <td>
                                    @v.Id
                                </td>
                                <td>
                                    @v.Title
                                </td>
                            </tr>
                        
                    
                        }
                    </table>


                </td>
            </tr>
        }
    </table>
}

